<template>
  <div>
    <div class="recommend-title">热销推荐</div>
    <ul>
      <router-link
        :to="'/detail/'+item.id"
        tag="li"
        class="item border-bottom"
        v-for="item of recommendList"
        :key="item.id"
      >
        <!-- <li
   
        > -->
        <!-- <div class="item-img-wrapper"> -->
        <img class="item-img" :src="item.imgUrl" />
        <!-- </div> -->
        <div class="item-info">
          <p class="item-title">{{ item.title }}</p>
          <p class="item-desc">{{ item.desc }}</p>
          <button class="item-button">查看详情</button>
        </div>
        <!-- </li> -->
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props: {
    recommendList: Array
  },
  data() {
    return {
      //   recommendList: [
      //     {
      //       id: '0001',
      //       imgUrl:
      //         'https://imgs.qunarzz.com/p/p67/1512/a2/0ebfcd965b9391f7.jpg_256x160_04d5813d.jpg',
      //       title: '佛山-三亚',
      //       desc: '含往返飞机票(含税)+4晚住宿'
      //     },
      //     {
      //       id: '0002',
      //       imgUrl:
      //         'https://imgs.qunarzz.com/p/p70/1809/e7/4941057a6aae702.jpg_256x160_9fee6ccb.jpg',
      //       title: '佛山-丽江',
      //       desc: '含往返飞机票(含税)+4晚住宿'
      //     },
      //     {
      //       id: '0003',
      //       imgUrl:
      //         'https://imgs.qunarzz.com/p/p15/1809/19/494898a39defb102.jpg_256x160_cc948293.jpg',
      //       title: '佛山-北京',
      //       desc: '含往返飞机票(含税)+4晚住宿'
      //     },
      //     {
      //       id: '0004',
      //       imgUrl:
      //         'https://imgs.qunarzz.com/sight/p55/201211/01/c5fe1b2433af76c993835fbb.jpg_256x160_417d815e.jpg',
      //       title: '佛山',
      //       desc: '含往返火车票+5晚住宿'
      //     }
      //   ]
    }
  }
}
</script>

<style lang="stylus" scoped>
@import '~style/mixins.styl';

.recommend-title {
  line-height: 0.8rem;
  background: #eee;
  text-indent: 0.2rem;
  font-size: 0.16rem;
  margin-top: 0.2rem;
}

.item {
  font-size: 0.16rem;
  display: flex;
  height: 1.9rem;
  overflow: hidden;

  .item-img {
    width: 1.7rem;
    height: 1.7rem;
    padding: 0.1rem;
  }

  .item-info {
    flex: 1;
    padding: 0.1rem;

    .item-title {
      line-height: 0.54rem;
      font-size: 0.32rem;
      ellipsis();
    }

    .item-desc {
      line: height 0.4rem;
      color: #ccc;
      ellipsis();
    }

    .item-button {
      margin-top: 0.16rem;
      background: #ff9300;
      line-height: 0.44rem;
      border-radius: 0.06rem;
      color: #fff;
      padding: 0.1rem;
    }
  }
}
</style>
